import store from "@/store";
import dayjs from "dayjs";
console.log(88);
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};

export const formBase = [
  {
    label: "交易时间",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    label: "会员ID",
    type: "input",
    field: "userId",
  },
  {
    label: "店铺",
    type: "select",
    field: "store",
    optionsKey: "shopName",
    optionsValue: "id",
    options: store.state.custom_dict.shop,
  },
];
export const tableBase = [
  {
    label: "银行名称",
    prop: "bankName",
    width: "200",
  },
  {
    label: "交易号",
    prop: "transactionNumber",
    width: "200",
  },
  {
    label: "联络手机",
    prop: "telephone",
    width: "200",
  },
  {
    label: "凭证图片地址",
    prop: "voucherPictureUrl",
    slotName: "voucherPictureUrl",
    width: "200",
  },
  {
    label: "人民币金额",
    prop: "rmbAmountOfMoney",
    width: "200",
  },
  {
    label: "转换币别金额",
    prop: "currencyAmountConverted",
    width: "200",
  },
  {
    label: "付款姓名",
    prop: "paymentName",
    width: "200",
  },
  {
    label: "交易时间",
    prop: "transactionDate",
    width: "200",
  },
  {
    label: "会员姓名",
    prop: "userName",
    width: "200",
  },
  {
    label: "会员ID",
    prop: "userId",
    width: "200",
  },
  {
    label: "店铺",
    prop: "store",
    width: "200",
  },
  {
    label: "是否通过",
    prop: "isPass",
    width: "200",
    slotName: "ispass",
  },
  {
    label: "审核人",
    prop: "reviewedBy",
    width: "200",
  },
  {
    label: "审核时间",
    prop: "reviewedDate",
    width: "200",
  },
  {
    label: "备注",
    prop: "remark",
    width: "200",
  },
];
